<!DOCTYPE html>
<html>

<head>
    <title>优惠券领卷表</title>
    <#include "/header.html">
    <!-- 文件上传 -->
    <link rel="stylesheet" href="${request.contextPath}/statics/plugins/oss/style.css">
    <script type="text/javascript" src="${request.contextPath}/statics/plugins/oss/js/plupload.full.min.js"></script>
    <script type="text/javascript" src="${request.contextPath}/statics/plugins/oss/ziyun_library.js"></script>
</head>

<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn">
            <form class="form-inline" role="form">
                <div class="form-group">
                    <a @click="reset">
                        <i class="fa fa-refresh"></i>
                    </a>
                </div>&nbsp;&nbsp;&nbsp;
                <a class="btn btn-primary btn-sm " @click="query">
                    <i class="fa fa-search"></i>&nbsp;查询</a>
                <div class="form-group">
                    <input type="text" class="form-control input-sm" v-model="q.couponTitel" placeholder="优惠券标题">
                </div>&nbsp;&nbsp;&nbsp;
                <a class="btn btn-primary btn-sm" @click="add">
                    <i class="fa fa-plus"></i>&nbsp;新增</a>
                <a class="btn btn-primary btn-sm" @click="update">
                    <i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
            </form>
        </div>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <div v-show="!showList" class="panel panel-default" align="center">
        <div class="panel-heading">{{title}}</div>
        <form class="form-horizontal">
            <input type="hidden" v-model="configCouponUcenter.id">
            <div class="form-group">
                <div class="col-sm-2 control-label"><span style="color: red">*&nbsp;</span>优惠券标题</div>
                <div class="col-sm-10">
                    <select v-model="configCouponUcenter.couponId" class="form-control input-sm">
                        <option  v-for="item  in couponList" :value="item.id">{{item.name}}</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">渠道类型</div>
                <div class="col-sm-10">
                    <select v-model="configCouponUcenter.couponType" class="form-control input-sm" :disabled="configCouponUcenter.id!=null">
                        <option value=0>领卷中心</option>
                        <option value=1>积分兑换</option>
                        <option value=2>活动发券</option>
                    </select>
                </div>
            </div>

            <div class="form-group" v-show="configCouponUcenter.couponType==1">
                <div class="col-sm-2 control-label"><span style="color: red">*&nbsp;</span>兑换优惠券所需积分</div>
                <div class="col-sm-10">
                    <input type="number" class="form-control input-sm" v-model="configCouponUcenter.couponPoint" placeholder="兑换优惠券所需的积分" />
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label"><span style="color: red">*&nbsp;</span>优惠券兑换数量</div>
                <div class="col-sm-10">
                    <input type="number" class="form-control input-sm" v-model="configCouponUcenter.exchangeNum" placeholder="优惠券兑换数量" />
                </div>
            </div>



            <div class="form-group">
                <div class="col-sm-2 control-label"><span style="color: red">*&nbsp;</span>发放总数量上限</div>
                <div class="col-sm-10">
                    <input type="number" class="form-control input-sm" v-model="configCouponUcenter.couponMaxGive" placeholder="发放总数量上限" />
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">是否发放</div>
                <div class="col-sm-10">
                    <select v-model="configCouponUcenter.couponGive" class="form-control input-sm" :disabled="configCouponUcenter.id!=null">
                        <option value=0>下架</option>
                        <option value=1>上架</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">排序</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control input-sm" v-model="configCouponUcenter.sort" placeholder="排序" :disabled="configCouponUcenter.id!=null"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">图片</div>
                <div class="col-sm-2">
                    <a class="btn btn-info btn-sm" id="uploadImage">上传图片</a><p style="color: red">积分兑换必须上传图片</p>
                </div>
                <div class="col-sm-2" v-if="configCouponUcenter.imageUrl !=null">
                    <img :src="window.parent.vm.ossHost+configCouponUcenter.imageUrl"
                         style="width: 200px">
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary  btn-sm" @click="saveOrUpdate" value="确定" /> &nbsp;&nbsp;
                <input type="button" class="btn btn-warning  btn-sm" @click="reload" value="返回" />
            </div>
        </form>
    </div>
</div>

<script src="${request.contextPath}/statics/js/modules/promotion/configcouponucenter.js?_${.now?long}"></script>
</body>

</html>
